Rule.notEmpty = function(value, element)
{
	if(value == "" || value == null || value.length == 0) {
		return false;
	} else {
		if (!value.replace(/^\s*|\s*$/g , "")) {
			return false;
		}
	}
	return true;
}

Rule.ckeckbox = function(value, name, limit)
{
	var els   = document.getElementsByName( name ),
	    count = 0,i = 0;
	
	limit = limit || 1;
	
	for (i = 0; i < els.length; i++) {
		if (els[i].checked) {
			count++;
		}
		
		if (count == limit) {
			return true;
		}
	}
	return false;
}

Rule.radio = function(value, name)
{
	var els = document.getElementsByName(name),
	    i = 0;
	
	for (i = 0; i < els.length; i++) {
		if (els[i].checked) {
			return true;
		}
	}
	return false;
}
